{{define "archives"}}
    {{template "layout/header" .Header}}
    {{template "layout/left" .Auth}}
    <div class="main-wrapper">
        <section class="blog-list px-3 py-5 p-md-5">
            <div class="container">
                <h3 class="text-center">文章归档</h3>
                {{range $index, $item := .Archives}}
                <div class="mt-2 mb-2 border-top shadow-sm">
                    <h1 class="d-block font-weight-bold font-italic">
                        <a class="btn btn-link text-dark" data-toggle="collapse" href="#collapse{{$index}}" role="button" aria-expanded="true" aria-controls="collapseExample" style="font-size: 1.5rem">
                        <i class="fa fa-calendar mr-3"></i>
                            {{- $index -}}
                        </a>
                    </h1>
                    <div class="collapse show" id="collapse{{$index}}">
                        <div class="card border-0 border-bottom">
                            <ul class="list-group list-group-flush">
                                {{range $i, $v := $item}}
                                    {{with $v}}
                                <li class="list-group-item font-weight-light d-flex justify-content-between">
                                    <a class="btn more-link" href="/detail/{{.ID}}" title="{{setLinkTitle .Title}}" target="_blank">{{- .Title -}} <span class="badge badge-dark ml-3">{{- .ViewNum -}}</span></a>
                                    <span class="text-right d-none d-md-block d-lg-block">{{.CreatedAt}}</span>
                                </li>
                                    {{end}}
                                {{end}}
                            </ul>
                        </div>
                    </div>
                </div>
                {{end}}
            </div>
        </section>
        {{template "layout/section_footer"}}
    </div>
    {{template "layout/footer"}}
{{end}}